// Package tree_attribute 104_max_deepth
// @Title tree_attribute
// @Description
// @Author  == 琳琳也叫王木木 ==  2021/9/1 18:38
// @Create  2021/9/1 18:38
package tree_attribute

import (
	"go_leetcode/special_practice/3_tree"
	"math"
)

func MaxDepth(root *__tree.MyTreeNode) int {
	if root == nil {
		return 0
	}
	left := MaxDepth(root.Left)
	right := MaxDepth(root.Right)
	return int(math.Max(float64(left), float64(right))) + 1
}
